package com.gkwave.action.service;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.gkwave.module.bean.TradeProductBean;
import com.gkwave.module.dao.TradeProductDAO;
import com.gkwave.util.CloseTradingProduct;

public class TradeProductListService extends BaseService {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8676783680975594195L;

	@Override
	public void procesRequest(HttpServletRequest request,
							  HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		String idUser = request.getParameter("idUser");
		Integer id_user = 9999;
		new CloseTradingProduct();
		try{
			id_user = Integer.parseInt(idUser);
			TradeProductDAO dao = new TradeProductDAO();
			TradeProductBean bean = dao.getTradeProductList(id_user);
			xmlResponse = bean.marsel(bean);
		}catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		out = response.getWriter();
		System.out.println(xmlResponse);
		out.println(xmlResponse);
	}

}
